<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>返回当前会话状态</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.session-start.html">« session_start</a></li>
      <li style="float: right;"><a href="function.session-unset.html">session_unset »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.session.html">Session 函数</a></li>
    <li>返回当前会话状态</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.session-status" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">session_status</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.4.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">session_status</span> &mdash; <span class="dc-title">返回当前会话状态</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.session-status-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>session_status</strong></span>(): <span class="type">int</span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>session_status()</strong></span> 被用于返回当前会话状态。
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.session-status-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara"><strong><code>PHP_SESSION_DISABLED</code></strong> 会话是被禁用的。</span>
    </li>
    <li class="listitem">
     <span class="simpara"><strong><code>PHP_SESSION_NONE</code></strong> 会话是启用的，但不存在当前会话。</span>
    </li>
    <li class="listitem">
     <span class="simpara"><strong><code>PHP_SESSION_ACTIVE</code></strong> 会话是启用的，而且存在当前会话。</span>
    </li>
   </ul>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.session-status-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="function.session-start.html" class="function" rel="rdfs-seeAlso">session_start()</a> - 启动新会话或者重用现有会话</span></li>
  </ul>
 </div>


</div></div></div></body></html>